import { LogHelper } from "../../utils/logHelper";

export class RemoveAllConstructionSite implements IFlagTask{
  run(flag: Flag): void {
    let room = flag.room;
    if(room){
      const sites = room.find(FIND_CONSTRUCTION_SITES);
      for(const site of sites){
        const result = site.remove();
        if(result === OK){
          LogHelper.log(`Removed construction site at (${site.pos.x},${site.pos.y})`);
        }else{
          LogHelper.log(`Failed to remove construction site at (${site.pos.x},${site.pos.y}): ${result}`);
        }
      }
    }
    flag.remove();
  }
}